import { lazy } from "react";
const Home = lazy(() => import("../pages/Home/index"));
const Error = lazy(() => import("../pages/Error/index"));
const Detail = lazy(() => import("../pages/Detail/index"));
const Login = lazy(() => import("../pages/Login/index"));
const List = lazy(() => import("../pages/List/index"));
const Layout = lazy(() => import("../pages/Layout/index"));
const My = lazy(() => import("../pages/My/index"));
import {createBrowserRouter} from 'react-router-dom'
const router=createBrowserRouter([
    {
        path:'/',
        element:<Layout/>,
        children:[
            {
                path:'/',
                element:<Home/>
            }
        ]
    },{
        path:'/detail',
        element:<Detail/>
    },{
        path:'/login',
        element:<Login/>
    },{
        path:'/list',
        element:<List/>
    },{
        path:'/my',
        element:<My/>
    },{
        path:'*',
        element:<Error/>
    }
])

export default router